Number Line

Points on line

P_1

P_2

P_3

P_G

Show P_G

Locus

Move point A and guess
the rules between it and
the other points.

u = false
A = Point(xAxis)
P_1 = If(u, (x(A) + 1, 0), (x(A) + 1, 1))
P_2 = If(u, (2 * x(A), 0), (2 * x(A), 1))
a = 0.5 (slider from -5 to 5, step 0.5)
b = -1.5 (slider from -5 to 5, step 0.5)
P_G = If(u, (a * x(A) + b, 0), (a * x(A) + b, 2))
P_3 = If(u, (-x(A), 0), (-x(A), 1))
c = OrthogonalLine(P_3, xAxis)
d = OrthogonalLine(P_G, xAxis)
e = OrthogonalLine(P_2, xAxis)
f = OrthogonalLine(P_1, xAxis)
B = Intersect(c, xAxis)
C = Intersect(d, xAxis)
D = Intersect(f, xAxis)
E = Intersect(e, xAxis)
g = Segment(P_3, B)
h = Segment(P_G, C)
i = Segment(P_1, D)
j = Segment(P_2, E)
k = false
l = false
m = false
n = false
o = false
bCond = If(a ≟ 0, "", If[b > 0, " + " * b, If[b < 0, " - " * abs(b), ""]])
aCond = If(a > 0, a * " A", If[a < 0, " - " * abs(a) * " A", ""])
text2: "a = " + a + ""
text3: "b = " + b + ""
P_GText = If(a ≟ 0, "", "P_G = ")
text1: "" + P_GText + "" + (LaTeX[aCond]) + "" + (LaTeX[bCond]) + ""
xA: x(A)
text4: "A = " + xA + ""
P: (x(A), x(P_G))
loc1 = Locus(P, A)
p = false
q = OrthogonalLine(P, yAxis)
r = OrthogonalLine(P, xAxis)
F = Intersect(r, xAxis)
G = Intersect(yAxis, q)
s = Segment(P, G)
t = Segment(P, F)